﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Spun.Communications
{
    public sealed class ExceptionSummary
    {
        public ExceptionSummary() { }

        public ExceptionSummary(Exception e)
        {
            Message = e.Message;
            StackTrace = LinePattern.Split(e.StackTrace);
        }

        public string[] StackTrace { get; set; }
        public string Message { get; set; }

        private static Regex LinePattern;
        static ExceptionSummary()
        {
            LinePattern = new Regex(@"\r\n");
        }
    }
}
